package offer;

import java.util.Arrays;

/**
 * Creared with IntelliJ IDEA.
 * Description:给定一个未排序的整数数组nums，请你找出其中没有出现的最小的正整数
 * User:yxd
 * Date:2022-08-11
 * Time:23:06
 */
public class BM53 {
    public int minNumberDisappeared (int[] nums) {
        // write code here
        Arrays.sort(nums);
        int count = 1;
        for(int i = 0;i < nums.length;i++){
            if(nums[i] > 0 && nums[i] == count){
                count++;
            }
        }
        return count;
    }
}
